#!/usr/bin/env python
#coding:utf-8

import cgi
import sqlite3
import cgitb;cgitb.enable()

conn = sqlite3.connect("input.db")
curs = conn.cursor()

print "Content-type: text/html\n"
print "<html><body>"
print """\
<h1>信息列表</h1>
<a href="/wiki/add/input.html" >Input</a>|
<a href="/wiki/add/list.py" >List</a>| 
<a href="/wiki/add/query.py" >Query</a><br />
<hr>
"""

rec = curs.execute("select * from address")
#index = 0
for i in rec.fetchall():
    for a in i:
        print a,
#    index += 1
    print '<a href="#%s">[编辑]</a>|<a href="dele.py?id=%s">[删除]</a>' % (i[0], i[0])
    print "<br />"

conn.close()
print "</body></html>"
